/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package comercial.view;

import comercial.model.Venda;

/**
 *
 * @author PC
 */
public class Main {
    
    private static  Venda[] v;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        System.out.println("Starting");
        
        v = new Venda[3];
        v[0] = new Venda(1, 2, 3, "22/01/2012");
        v[1] = new Venda(1, 2, 1, "22/01/2012");
        v[2] = new Venda(3, 2, 1, "22/01/2012");
        
        //System.out.println(v[2].getData());
        //System.out.println(getTotalVendas("22/01/2012"));
    }
    
    public int getTotalVendas(String data){
        int total_vendas = 0;
        for (int i=0; i <v.length; i++)
        {
            if (v[i].getData().equals(data))
                total_vendas+=v[i].getTotalQTDVendas();
        }
        return total_vendas;
    }

}
